import 'package:json_annotation/json_annotation.dart';

part 'fight_succ.g.dart';

@JsonSerializable()
class FightSucc {
  final GradeScoreInfo gradeScore;
  final List<AwardInfo> awardList;

  FightSucc({this.gradeScore, this.awardList});

  factory FightSucc.fromJson(Map<String, dynamic> json) =>
      _$FightSuccFromJson(json);

  Map<String, dynamic> toJson() => _$FightSuccToJson(this);
}

@JsonSerializable()
class GradeScoreInfo {
  // 0 -- 未通关 10 -- C级 20 -- B级 30 -- A级 40 -- S级
  final int grade;
  final int score;

  GradeScoreInfo({this.grade, this.score});

  factory GradeScoreInfo.fromJson(Map<String, dynamic> json) =>
      _$GradeScoreInfoFromJson(json);

  Map<String, dynamic> toJson() => _$GradeScoreInfoToJson(this);
}

@JsonSerializable()
class AwardInfo {
  final int type;
  final String id;
  final String itemName;
  final int count;
  final String pic;
  AwardInfo({this.type, this.id, this.itemName, this.count, this.pic});

  factory AwardInfo.fromJson(Map<String, dynamic> json) =>
      _$AwardInfoFromJson(json);

  Map<String, dynamic> toJson() => _$AwardInfoToJson(this);
}
